<script setup lang="ts">
import { SuccessFilled, WarningFilled } from '@element-plus/icons-vue';
defineProps(['state', 'type'])
</script>
<template>
  <template v-if="type === 'icon'">
    <el-icon :class="['icon', state ? 'success' : 'danger']">
      <SuccessFilled v-if="state" />
      <WarningFilled v-else />
    </el-icon>
  </template>
  <el-tag v-else :type="state ? 'success' : 'danger'" effect="dark">
    {{ state ? '成功' : '失败' }}
  </el-tag>
</template>
<style lang="scss" scoped>
.icon {
  font-size: 24px;
}

.danger {
  color: var(--el-color-danger);
}

.success {
  color: var(--el-color-success);
}
</style>